/*
 * Entreprise.java
 *
 * Created on 13 avril 2007, 17:46
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.Vector;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 * Entity class Entreprise
 *
 * @author amo-yas-nico
 */
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public class Entreprise implements Serializable {
    
    @Id
    protected int id;
    //NOM DE L'ENTREPRISE
    protected String nom_Entreprise;
    //CAPITAL DE L'ENTREPRISE
    protected double capital_Entreprise;
    protected double remuneration_Entreprise;
    @OneToMany(fetch=FetchType.EAGER)
    protected Collection <Landien> sesLandiens;
    
    @OneToMany(fetch=FetchType.EAGER)
    protected Collection <Emprunt> sesEmprunts;
    
    
        
    /** Creates a new instance of Entreprise */
    public Entreprise() {
    }
    public Entreprise(int id, double capital_Entreprise, String nom_Entreprise, double remuneration_Entreprise ) {
        this.id=id;
        this.nom_Entreprise=nom_Entreprise;
        this.capital_Entreprise=capital_Entreprise;
        this.remuneration_Entreprise=remuneration_Entreprise;
        
        
        
    }
    /**
     * Gets the id of this Entreprise.
     * @return the id
     */
    public int getId() {
        return this.id;
    }
    
    /**
     * Sets the id of this Entreprise to the specified value.
     * @param id the new id
     */
    public void setId(int id) {
        this.id = id;
    }
    
    /**
     * Returns a hash code value for the object.  This implementation computes
     * a hash code value based on the id fields in this object.
     * @return a hash code value for this object.
     */
   /* @Override
    public int hashCode() {
        int hash = 0;
        hash += (this.getId() != null ? this.getId().hashCode() : 0);
        return hash;
    }*/
    
    /**
     * Determines whether another object is equal to this Entreprise.  The result is
     * <code>true</code> if and only if the argument is not null and is a Entreprise object that
     * has the same id field values as this object.
     * @param object the reference object with which to compare
     * @return <code>true</code> if this object is the same as the argument;
     * <code>false</code> otherwise.
     */
  /*  @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Entreprise)) {
            return false;
        }
        Entreprise other = (Entreprise)object;
        if (this.getId() != other.getId() && (this.getId() == null || !this.getId().equals(other.getId()))) return false;
        return true;
    }*/
    
    /**
     * Returns a string representation of the object.  This implementation constructs
     * that representation based on the id fields.
     * @return a string representation of the object.
     */
    @Override
    public String toString() {
        return "Entity.Entreprise[id=" + getId() + "]";
    }
    
    public String getNom_Entreprise() {
        return nom_Entreprise;
    }
    
    public void setNom_Entreprise(String nom_Entreprise) {
        this.nom_Entreprise = nom_Entreprise;
    }
    
    public double getCapital_Entreprise() {
        return capital_Entreprise;
    }
    
    public void setCapital_Entreprise(double capital_Entreprise) {
        this.capital_Entreprise = capital_Entreprise;
    }
    
    public double getRemuneration_Entreprise() {
        return remuneration_Entreprise;
    }
    
    public void setRemuneration_Entreprise(double remuneration_Entreprise) {
        this.remuneration_Entreprise = remuneration_Entreprise;
    }

    public Collection<Landien> getSesLandiens() {
        return sesLandiens;
    }

    public void setSesLandiens(Collection<Landien> sesLandiens) {
        this.sesLandiens = sesLandiens;
    }

    public void setSesLandiens(boolean b) {
        throw new UnsupportedOperationException("Not yet implemented");
    }
    
    
    
}
